import request from '@/utils/request'

   //联系人
export function contacts(data) {
  return request({
    url: 'contacts',
    method: 'get',
    params: data,
    headers: {
      showLoading: true
    }
  })
}
//新增
export function contactsCreate(data) {
  return request({
    url: 'contacts/create',
    method: 'post',
    data,
    headers: {
      showLoading: false
    }
  })
}
//详情
export function contactsRead(data,showLoading) {
  return request({
    url: 'contacts/read',
    method: 'get',
    params: data,
    headers: {
      showLoading: showLoading,
      'loadingTarget':'.innerLoding'
    }
  })
}
//编辑
export function contactsUpdate(data) {
  return request({
    url: 'contacts/update',
    method: 'put',
    data,
    headers: {
      showLoading: false
    }
  })
}
//删除
export function contactDelete(data) {
  return request({
    url: 'contacts/delete',
    method: 'delete',
    data,
    headers: {
      showLoading: false
    }
  })
}
//
export function contactsSearch(data) {
  return request({
    url: 'contacts/search',
    method: 'get',
    params:data,
    headers: {
      showLoading: false
    }
  })
}
export function relation(data) {
  return request({
    url: 'contacts/relation',
    method: 'post',
    data,
    headers: {
      showLoading: false
    }
  })
}